﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using COP.Extensions;
using System.Collections;
using COP.Extractors;
using COP.Objects.Maps;

namespace COP.Objects.Config
{
    public class ManyToManyConfig : OneToManyConfig
    {
        public ManyToManyConfig(IExtractor extractor) : base(TagType.ManyToMany, extractor) { }

        protected override MAPBase OnCreateSingleMAP(object valNode)
        {
            MAPBase map = base.OnCreateSingleMAP(valNode);
            if (string.IsNullOrEmpty(map.Key))
                throw new Exception(Constant.Error.KeyRequired);
            else
                return map;
        }

        public override object PullValue()
        {
            return this.Maps;
        }
    }

}